<?php
require_once $_SERVER['DOCUMENT_ROOT']."/loja/funcoes/funcoes_basicas.php";

echo "FRETE: <select name=\"local\" onChange=\"javascript:Loja('frete', this.options[this.selectedIndex].value);\">";
echo "<option>Escolha o local de entrega</option>\n";

$sqlFrete = "SELECT distinct(local) 
               FROM frete 
           ORDER BY local";
$res = mysql_query($sqlFrete)or die(errorHandler($sqlFrete, mysql_error(), __LINE__, __FILE__));
for ($i=0; $i<mysql_num_rows($res); $i++)
{
    $dados = mysql_fetch_row($res);
    $local = $dados[0];
    echo "<option ";
    if($local==$localFrete)
    {
        echo "selected ";
    }
    echo "value=\"$local\">$local</option>\n";
}
echo "</select>";
?>